Toss non-ascii characters in mkshort.
authorrobertl <robertl>
Thu, 19 Jun 2008 14:49:08 +0000 (14:49 +0000)
committerrobertl <robertl>
Thu, 19 Jun 2008 14:49:08 +0000 (14:49 +0000)
mkshort.c

index e1e1b96fa395bde40ca68d6169a403779af7619f..9add38dc6b62f1323ff2b4587483aef64ebb264e 100644 (file)
--- a/mkshort.c
+++ b/mkshort.c
@@ -382,7 +382,6 @@ mkshort(short_handle h, const char *istring)
        int i, l, nlen, replaced;
        mkshort_handle *hdl = (mkshort_handle *) h;
 
-
        /*
         * A rather horrible special case hack.
         * If the target length is "6" and the source length is "7" and
@@ -454,6 +453,8 @@ mkshort(short_handle h, const char *istring)
                        continue;
                if (hdl->goodchars && (!strchr(hdl->goodchars, tstring[i])))
                        continue;
+               if (!isascii(tstring[i]))
+                       continue
                *cp++ = tstring[i];
        }
        *cp = 0;